<template>
	<Table filter v-bind="tableOpts" v-on="tableEvent">
		<template #operator>
			<div class="operator-wrap">
				<InventoryRecordDetail ref="dialogRef" @change="fetchCurrentTable" />
			</div>
		</template>
	</Table>
</template>

<script>
import { INOUT_STATUS } from "@/assets/js/params.js";
import tableMixins from "@/mixins/tableMixins.vue";
import dayjs from "dayjs";
import InventoryRecordDetail from './InventoryRecordDetail.vue';

export default {
	name: "InventoryRecord",
	mixins: [tableMixins],
	components: {
		InventoryRecordDetail,
	},
	data () {
		return {
			apiName: "getInout",
			form: {
				productName: {
					tag: "el-input",
					label: "产品名称",
					value: "",
					props: {
						clearable: true,
						placeholder: "请输入产品名称",
					},
				},
				productCode: {
					tag: "el-input",
					label: "产品编码",
					value: "",
					props: {
						clearable: true,
						placeholder: "请输入产品编码",
					},
				},
				// directoryId: this.formDirectoryId(),
				areaId: this.formArea(),
				status: {
					tag: "el-select",
					label: "出入库状态",
					value: "",
					items: Object.entries(INOUT_STATUS).map(([value, label]) => ({
						label,
						value,
					})),
					props: {
						clearable: true,
						filterable: true,
					},
				},
				creator: {
					tag: "el-input",
					label: "操作人",
					value: "",
					props: {
						clearable: true,
						placeholder: "请输入操作人",
					},
				},
				date: {
					tag: "el-date-picker",
					label: "创建时间",
					value: [],
					props: {
						rangeSeparator: "至",
						startPlaceholder: "开始时间",
						endPlaceholder: "结束时间",
						type: "datetimerange",
						defaultTime: ["00:00:00", "23:59:59"],
					},
				},
			},
		};
	},
	computed: {},
	mounted () { },
	methods: {
		handleAction (opts, row) {
			if (opts === "detail") return this.showDialog(opts, row);
		},
	}
}
</script>

<style lang="less" scoped></style>

